Skip to content

Conversation

@Sodawyx
Copy link
Collaborator

@Sodawyx Sodawyx commented Jan 12, 2026

Change-Id: I40733b161d8ab1333cc83cfdbb5f32e6e2ff2638
Co-developed-by: Aone Copilot noreply@alibaba-inc.com

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive knowledge base (KB) capability to the AgentRun SDK, supporting both Bailian and RagFlow providers. The feature enables knowledge base management (CRUD operations) and retrieval functionality, with seamless integration across multiple AI frameworks.

Changes:

  • Added complete knowledge base module with support for Bailian and RagFlow providers
  • Integrated KB retrieval as toolsets for LangChain, LangGraph, CrewAI, PydanticAI, Google ADK, and AgentScope
  • Updated SDK version from 0.0.9 to 0.0.10 and bumped dependency versions

Reviewed changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
pyproject.toml Version bump to 0.0.10, added bailian SDK dependency and knowledgebase extras
agentrun/utils/config.py Added bailian_endpoint configuration support
agentrun/utils/control_api.py Added _get_bailian_client method for Bailian API access
agentrun/utils/data_api.py Added KnowledgeBase resource type
agentrun/knowledgebase/* Core KB module with models, client, APIs, and resource management
agentrun/integration/*/builtin.py Added knowledgebase_toolset functions for all frameworks
examples/*.py Added comprehensive KB examples and updated quick_start with KB integration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# 返回结果 / Return result
data = result.get("data", {})

if data == False:
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using == False is not the recommended way to check for falsy values in Python. This comparison will only match the exact boolean value False, but not other falsy values like empty strings, None, 0, etc. Use if not data: or if data is False: depending on whether you want to check for any falsy value or specifically False.

Suggested change
if data == False:
if data is False:

Copilot uses AI. Check for mistakes.
# 返回结果 / Return result
data = result.get("data", {})

if data == False:
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using == False is not the recommended way to check for falsy values in Python. This comparison will only match the exact boolean value False, but not other falsy values. Use if not data: or if data is False: depending on the intent.

Suggested change
if data == False:
if data is False:

Copilot uses AI. Check for mistakes.
# 返回结果 / Return result
data = result.get("data", {})

if data == False:
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using == False is not the recommended way to check for falsy values in Python. Use if not data: or if data is False: depending on the intent.

Suggested change
if data == False:
if data is False:

Copilot uses AI. Check for mistakes.

try:
client = self._get_client(config)
response = await client.update_knowledgebase_with_options_async(
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The async method name is incorrect. It should be update_knowledge_base_with_options_async instead of update_knowledgebase_with_options_async (missing underscore). This typo will cause the async update functionality to fail.

Suggested change
response = await client.update_knowledgebase_with_options_async(
response = await client.update_knowledge_base_with_options_async(

Copilot uses AI. Check for mistakes.
@Sodawyx Sodawyx force-pushed the feat-knowledge-base branch 3 times, most recently from c5aa1eb to 5c7999f Compare January 12, 2026 12:30
@OhYee OhYee enabled auto-merge January 12, 2026 12:30
OhYee
OhYee previously approved these changes Jan 12, 2026
Change-Id: I7787c114a02f37e76a0a5dd97f1c0f005e17760c
Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>
Signed-off-by: Sodawyx <sodawyx@126.com>
@OhYee OhYee disabled auto-merge January 12, 2026 12:38
@OhYee OhYee enabled auto-merge January 12, 2026 12:39
@OhYee OhYee disabled auto-merge January 12, 2026 12:41
@OhYee OhYee merged commit 52c1e6e into main Jan 12, 2026
2 checks passed
@OhYee OhYee deleted the feat-knowledge-base branch January 12, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants